package com.hezhou.oauth2.web.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hezhou.oauth2.web.entities.SysUser;

/**
 * ---------------------------
 * (SysUserService) 系统用户数据逻辑层
 * ---------------------------
 *
 * @Author: [hezhou]
 * @Date: 2020/3/6
 * @Version: [1.0.1]
 * ---------------------------
 */
public interface SysUserService extends IService<SysUser> {

    /**
     * 根据名字查询用户信息
     * @param name 用户名
     * @return
     */
    SysUser findByUserName(String name);

    SysUser findByUserMobile(String mobile);

    /**
     * 分页模糊查询用户信息
     * @param page
     * @param sysUser
     * @return
     */
    IPage<SysUser> selectPageByCondition(Page<SysUser> page, SysUser sysUser);

    /**
     * 根据用户名查询所拥有的角色以及本身的信息
     * @return
     */
    SysUser findSysUserById(Long userId);

    /**
     * 新增或者修改
     * @param sysUser
     * @return
     */
    Boolean saveOrUpdateUser(SysUser sysUser);
}
